import Vue from "vue"

import VueRouter from "vue-router"
Vue.use(VueRouter)




// 组件
import AdminView from "@/views/AdminView/AdminView.vue"
import LoginView from "@/views/LoginView/LoginView.vue"
import RegisterView from "@/views/RegisterView/RegisterView.vue"



let routes = [{
    path: "/login",
    component: LoginView
}, {
    path: "/register",
    component: RegisterView
}, {
    path: "/admin/",
    component: AdminView,
    children: [{
        path: "user/list",
        component: () => import("@/views/UserView/UserList/UserList.vue")
    }, {
        path: "user/add",
        component: () => import("@/views/UserView/UserAdd/UserAdd.vue")
    }, {
        path: "user/level",
        component: () => import("@/views/UserView/UserLevel/UserLevel.vue")
    }],

}, {
    path: "/admin/",
    component: AdminView,
    children: [{
        path: "course/list",
        component: () => import("@/views/CourseView/CourseList/CourseList.vue")
    }, {
        path: "course/add",
        component: () => import("@/views/CourseView/CourseAdd/CourseAdd.vue")
    }, {
        path: "course/category",
        component: () => import("@/views/CourseView/CourseCategory/CourseCategory.vue")
    }]
}]

let router = new VueRouter({
    routes
})

export default router